Creating a Database Handler for an Excel Database
You define a database handler for a Microsoft Excel database in a similar manner to that described for an ODBC database. The following INI options are used to install the Excel handler to access a database defined as part of an Excel spreadsheet. The handler name in this example is NamesExcel.
< DBHandler:NamesExcel >
The Class option tells the DAL database handler what type of driver to use. Enter ODBC. This option is required.
The Server option specifies the user data sources name as shown on the ODBC Data Source Administrator window. This name specifies the ODBC driver to be used as the data source. The default drive is MS SQL Server.
This example shows how to add a user data source which is an Excel database named NamesExc. NamesExc is defined in an Excel spreadsheet entitled Names. The user data source name, NamesExc, is assigned to use the Microsoft Excel (ODBC) Driver (*.xls).
To add a new data source name, follow these steps:
- Click the Add button and select the ODBC driver to use. Then click Finish.
- Enter the desired Data Source Name and description. You can enter up to 22 characters for the data source name.
- Click the Workbook Selection button and select the path for the database. Then click OK.
Here is an example of the steps you would follow to define a database in an Excel spreadsheet.
- Enter the field names in the first row of each column that make up the table. Then enter the data in each column.
- Select the columns and rows that comprise the table.
- Choose the Insert, Name, Define option.
- Enter the name of the table on the Define Name window and click Add.
- Define the name of the worksheet and save it.